home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / text / misc / nroff.lha / nroff / tmac.s < prev    next >
Text File  |  1997-01-24  |  9KB  |  407 lines

  1. .\" set this non-zero to turn on debugging
  2. .nr Z 0
  3. .\" **************************************************************************
  4. .\"
  5. .\" partial -ms package for nroff. macros for simple paper/report formats
  6. .\"
  7. .\" usage: nroff -ms file [...]
  8. .\"
  9. .\" included here are:
  10. .\"
  11. .\"    TL, AU, AI, AB, AE, SH, NH, PP, LP, QP, XP, RS, RE, IP, I, B, R
  12. .\"
  13. .\" extensions include:
  14. .\"
  15. .\"    TI (temp indent), EX (exit NOW)
  16. .\"
  17. .\" includes somewhat kludgy support for XS, XA, XE, PX (table of contents)
  18. .\"
  19. .\" v1.10 7/22/90 rosenkra@convex.com (Bill Rosenkranz)
  20. .\" freely distributable (no copyright, etc.)
  21. .\" 
  22. .\" **************************************************************************
  23. .\"
  24. .\" some perdefined strings (Quote, Unquote, dash, footer parts, etc):
  25. .\"
  26. .ds Q ""
  27. .ds U ""
  28. .ds - --
  29. .ds CF "ImPoSsIbLe
  30. .ds LF "\0
  31. .ds RF "\0
  32. .\"
  33. .\" these are various predefined date and time strings
  34. .\"
  35. .\" DW day-of-week:
  36. .if \n(dw=1  .ds DW "Sun
  37. .if \n(dw=2  .ds DW "Mon
  38. .if \n(dw=3  .ds DW "Tue
  39. .if \n(dw=4  .ds DW "Wed
  40. .if \n(dw=5  .ds DW "Thu
  41. .if \n(dw=6  .ds DW "Fri
  42. .if \n(dw=7  .ds DW "Sat
  43. .\" MO month:
  44. .if \n(mo=1  .ds MO "January
  45. .if \n(mo=2  .ds MO "February
  46. .if \n(mo=3  .ds MO "March
  47. .if \n(mo=4  .ds MO "April
  48. .if \n(mo=5  .ds MO "May
  49. .if \n(mo=6  .ds MO "June
  50. .if \n(mo=7  .ds MO "July
  51. .if \n(mo=8  .ds MO "August
  52. .if \n(mo=9  .ds MO "September
  53. .if \n(mo=10 .ds MO "October
  54. .if \n(mo=11 .ds MO "November
  55. .if \n(mo=12 .ds MO "December
  56. .\" make some composites:
  57. .ds Dy "\*(MO \n(dy
  58. .ds Da "\n(hh:\n(mm:\n(ss \n(mo/\n(dy/\n(yr
  59. .ds Yr "19\n(yr
  60. .ds dY "\*(Dy, \*(Yr
  61. .ds DY "\n(dy \*(MO \*(Yr
  62. .ds TM "\n(hh:\n(mm:\n(ss
  63. .ds DA "\*(TM \*(DY
  64. .ds CT "\*(DW \*(Dy \*(TM 19\n(yr
  65. .\"
  66. .\" they look like this:
  67. .\"
  68. .\"    DW    Sun
  69. .\"    MO    March
  70. .\"     Dy    March 4
  71. .\"     dY    March 4, 1990
  72. .\"     DY    4 March 1990       <--- "normal" nroff form
  73. .\"    Yr    1990
  74. .\"     TM    16:34:00
  75. .\"     DA    16:34:00 March 4, 1990
  76. .\"    Da    16:34:00 2/4/90
  77. .\"     CT    Sun March 4 16:34:00 1990    almost like ctime(2)
  78. .\"
  79. .\" **************************************************************************
  80. .\"
  81. .\" startup stuff...
  82. .\"
  83. .pl 66
  84. .ll 6.0i
  85. .lt 6.0i
  86. .m1 3
  87. .m2 2
  88. .m3 3
  89. .m4 3
  90. .\" no header line on first page! (set back in AB, SH, NH, LP, PP, QP)
  91. .tl ||||
  92. .\" this is the default footer (date, centered) unless string CF is defined
  93. .fo ||\*(DY||
  94. .\" these are for NH numbering (up to 5 levels, a la sun, X holds level)
  95. .nr A 0 1
  96. .af A 1
  97. .nr B 0 1
  98. .af B 1
  99. .nr C 0 1
  100. .af C 1
  101. .nr D 0 1
  102. .af D 1
  103. .nr E 0 1
  104. .af E 1
  105. .nr X 1 1
  106. .\"
  107. .\" **************************************************************************
  108. .\"
  109. .\" MACROS...
  110. .\"
  111. .\" ---------------------------------------------------------------------- TL
  112. .\" title for document (optional)
  113. .\"
  114. .de TL
  115. .sp 4
  116. .ce 1000
  117. .\" reset footer. you MUST define CF, even to blank, to get the others!
  118. .if !"\*(CF"ImPoSsIbLe" .fo |\*(LF|\*(CF|\*(RF|
  119. ..
  120. .\" ---------------------------------------------------------------------- AU
  121. .\" author(s) (optional, requires .TL)
  122. .\"
  123. .de AU
  124. .sp 2
  125. ..
  126. .\" ---------------------------------------------------------------------- AI
  127. .\" author's institution (optional, requires .TL)
  128. .\"
  129. .de AI
  130. .sp 1
  131. ..
  132. .\" ---------------------------------------------------------------------- AB
  133. .\" abstract (optional, requires .TL, .AE)
  134. .\"
  135. .de AB
  136. .br
  137. .sp 2
  138. .\" check for arg to AB. can be "no" or something like "SUMMARY". if "no",
  139. .\" no title above the abstract
  140. .if !"$1"no" .if "$1"" ABSTRACT
  141. .if !"$1"no" .if !"$1"" $1
  142. .if !"$1"no" .sp 1
  143. .\" set new line length...
  144. .ce 0
  145. .ll 5.5i
  146. .in 0.5i
  147. .tl ||- % -||
  148. ..
  149. .\" ---------------------------------------------------------------------- AE
  150. .\" abstract end (optional, requires .TL)
  151. .\"
  152. .de AE
  153. .br
  154. .sp 1
  155. .\" reset...
  156. .ce 0
  157. .in 0.0i
  158. .ll 6.0i
  159. ..
  160. .\" ----------------------------------------------------------------------- SH
  161. .\" section heading, no number (optional)
  162. .\"
  163. .de SH
  164. .\" reset...
  165. .ll 6.0i
  166. .in 0.0i
  167. .tl ||- % -||
  168. .\" see note in TL
  169. .if !"\*(CF"ImPoSsIbLe" .fo |\*(LF|\*(CF|\*(RF|
  170. .br
  171. .ce 0
  172. .sp 2
  173. .ne 4
  174. .\" section title goes here, fill mode only so far...
  175. ..
  176. .\" ---------------------------------------------------------------------- NH
  177. .\" numbered section heading. arg (required) is the section level.
  178. .\" this would be MUCH simpler if the .if command supported "{...}". there is
  179. .\" a bug in nroff. i does not set the .$ number register correctly (number of
  180. .\" args for the current macro). that is the reason why level 1 must be set.
  181. .\"
  182. .de NH
  183. .\" do everything from SH...
  184. .SH
  185. .\" if ".NH 0", reset numbering
  186. .if $1=0 .nr A 1 1
  187. .if $1=0 .nr B 0 1
  188. .if $1=0 .nr C 0 1
  189. .if $1=0 .nr D 0 1
  190. .if $1=0 .nr E 0 1
  191. .if $1=0 .nr X 1 1
  192. .\" level 1 (two types here: ".NH" and ".NH 1"):
  193. .\" once .$ num reg is fixed, these 5 should be:  .if \n(.$=0 .nr A +1  etc.
  194. .if "$1""  .nr A +1
  195. .if "$1""  .nr B 0 1
  196. .if "$1""  .nr C 0 1
  197. .if "$1""  .nr D 0 1
  198. .if "$1""  .nr E 0 1
  199. .if "$1""  .nr X 1 1
  200. .if "$1"1" .nr A +1
  201. .if "$1"1" .nr B 0 1
  202. .if "$1"1" .nr C 0 1
  203. .if "$1"1" .nr D 0 1
  204. .if "$1"1" .nr E 0 1
  205. .if "$1"1" .nr X 1 1
  206. .\" level 2 (increment B, reset lower levels):
  207. .if "$1"2" .nr B +1
  208. .if "$1"2" .nr C 0 1
  209. .if "$1"2" .nr D 0 1
  210. .if "$1"2" .nr E 0 1
  211. .if "$1"2" .nr X 2 1
  212. .\" level 3 (increment C, reset lower levels):
  213. .if "$1"3" .nr C +1
  214. .if "$1"3" .nr D 0 1
  215. .if "$1"3" .nr E 0 1
  216. .if "$1"3" .nr X 3 1
  217. .\" level 4 (increment D, reset lower levels):
  218. .if "$1"4" .nr D +1
  219. .if "$1"4" .nr E 0 1
  220. .if "$1"4" .nr X 4 1
  221. .\" level 5 (increment E, no more lower levels!):
  222. .if "$1"5" .nr E +1
  223. .if "$1"5" .nr X 5 1
  224. .\" print out the section number now, depending on current level...
  225. .if \nX=1 \nA.
  226. .if \nX=2 \nA.\nB.
  227. .if \nX=3 \nA.\nB.\nC.
  228. .if \nX=4 \nA.\nB.\nC.\nD.
  229. .if \nX=5 \nA.\nB.\nC.\nD.\nE.
  230. .\" section title goes here...
  231. ..
  232. .\" ----------------------------------------------------------------------- LP
  233. .\" start a new left block paragraph (either .LP or .PP required)
  234. .\"
  235. .de LP
  236. .br
  237. .\" reset...
  238. .tl ||- % -||
  239. .ce 0
  240. .sp 1
  241. .ll 6.0i
  242. .in 0.0i
  243. ..
  244. .\" ----------------------------------------------------------------------- PP
  245. .\" start a new indented paragraph (either .LP or .PP required)
  246. .\"
  247. .de PP
  248. .\" do everything for LP, then make a temp indent...
  249. .LP
  250. .ti +0.5i
  251. ..
  252. .\" ----------------------------------------------------------------------- XP
  253. .\" start a new extended paragraph (bibliography)
  254. .\"
  255. .de XP
  256. .br
  257. .\" reset...
  258. .tl ||- % -||
  259. .ce 0
  260. .sp 1
  261. .ll 6.0i
  262. .in 0.5i
  263. .ti -0.5i
  264. ..
  265. .\" ----------------------------------------------------------------------- QP
  266. .\" start a new quoted paragraph (indented and shorter)
  267. .\"
  268. .de QP
  269. .br
  270. .tl ||- % -||
  271. .ce 0
  272. .sp 1
  273. .\" set new line length, indent. PP, LP, SH, and NH reset
  274. .ll 6.0i
  275. .in 0.0i
  276. .ll -0.5i
  277. .in +0.5i
  278. ..
  279. .\" ----------------------------------------------------------------------- IP
  280. .\" indented paragraph with tag (relative)
  281. .\"
  282. .de IP
  283. .br
  284. .tl ||- % -||
  285. .ce 0
  286. .sp 1
  287. .if \n(.i>4 .in -0.5i
  288. .in +0.5i
  289. .}D "***DEBUG IP: indent before tag is: \n(.i"
  290. .}D .br
  291. .if !"$1"" .ti -0.5i
  292. .if !"$1"" \&$1
  293. .if !"$1"" .br
  294. .}D "***DEBUG IP: indent after tag is: \n(.i"
  295. ..
  296. .\" ----------------------------------------------------------------------- RS
  297. .\" start relative indent (requires .RE)
  298. .\"
  299. .de RS
  300. .ce 0
  301. .br
  302. .\" if there is arg, use that as indent, otherwise use +5
  303. .if \n(.$>0 .in +$1
  304. .if \n(.$=0 .in +0.5i
  305. .}D "***DEBUG RS: indent after RS is: \n(.i"
  306. .}D .br
  307. ..
  308. .\" ----------------------------------------------------------------------- RE
  309. .\" end relative indent
  310. .\"
  311. .de RE
  312. .ce 0
  313. .br
  314. .\" if there is arg, use that as unindent, otherwise use -5
  315. .if \n(.$>0 .in -$1
  316. .if \n(.$=0 .in -0.5i
  317. .if \n(.i<5 .in 0.0i
  318. .}D "***DEBUG RE: indent after RE is: \n(.i"
  319. .}D .br
  320. ..
  321. .\" ----------------------------------------------------------------------- XS
  322. .\" table of contents start
  323. .\"
  324. .de XS
  325. .bp
  326. .ce 1
  327. Table of Contents
  328. .ce 0
  329. .ll 8.0i
  330. .sp 1
  331. .\" \&123456789012345678901234567890123456789012345678901234567890
  332. \&NOTE: add/del "dots" until line ends here ---------------->| (del this line)
  333. .br
  334. .\" save the page number...
  335. .ds Xx "$1
  336. .\" first entry goes here...
  337. ..
  338. .\" ----------------------------------------------------------------------- XE
  339. .\" table of contents end
  340. .\"
  341. .de XE
  342. .\" dump last page number...
  343. \&\0........................... \*(Xx
  344. .br
  345. ..
  346. .\" ----------------------------------------------------------------------- XA
  347. .\" subsequent table of contents entry
  348. .\"
  349. .de XA
  350. .\" dump last page number...
  351. \&\0........................... \*(Xx
  352. .br
  353. .\" save next page number...
  354. .ds Xx "$1
  355. .\" next entry goes here...
  356. ..
  357. .\" ----------------------------------------------------------------------- PX
  358. .\" print table of contents
  359. .\"
  360. .de PX
  361. .\" this is a NOP without diversions...
  362. .ll 6.0i
  363. ..
  364. .\" ----------------------------------------------------------------------- TI
  365. .\" temporary indent
  366. .\"
  367. .de TI
  368. .ce 0
  369. .ti +0.5i
  370. ..
  371. .\" ----------------------------------------------------------------------- EX
  372. .\" exit NOW! (no extra space at end of document)
  373. .\"
  374. .de EX
  375. .sp
  376. .ex
  377. ..
  378. .\" ----------------------------------------------------------------------- I
  379. .\" italic text
  380. .\"
  381. .de I
  382. \&\fI
  383. .if !"$1"" $1\fR$2
  384. ..
  385. .\" ----------------------------------------------------------------------- B
  386. .\" bold text
  387. .\"
  388. .de B
  389. \&\fB
  390. .if !"$1"" $1\fR$2
  391. ..
  392. .\" ----------------------------------------------------------------------- R
  393. .\" Roman (normal) text
  394. .\"
  395. .de R
  396. \&\fR
  397. ..
  398. .\" ----------------------------------------------------------------------- }D
  399. .\" debug. use (e.g. print current indent):
  400. .\"
  401. .\"    .}D .br
  402. .\"    .}D "** DEBUG ** before RS \n(.i"
  403. .\"
  404. .de }D
  405. .if \nZ>0 \&$1
  406. ..
  407.